{include file="public/head"}

<body>
<div id="wrapper">
    {include file="public/menu"}

    <div id="page-wrapper" class="gray-bg dashbard-1">
        {include file="public/nav"}
        <div class="row wrapper border-bottom white-bg page-heading">
            <div class="col-lg-10">
                <h2>会员信息</h2>
                <ol class="breadcrumb">
                    <li>
                        <a href="{:url('Index/index')}">主页</a>
                    </li>
                    <li>
                        <a>会员</a>
                    </li>
                    <li>
                        <strong>会员列表</strong>
                    </li>
                </ol>
            </div>
            <div class="col-lg-2">

            </div>
        </div>
        <div class="wrapper wrapper-content animated fadeInRight">
            <div class="row">
                <div class="col-lg-12">
                    <div class="ibox float-e-margins">
                        <div class="ibox-title">
                            <h5>会员信息列表</h5>
                            <div class="ibox-tools">
                                <small>共 {$Count} 条</small>
                            </div>
                        </div>

                        <div class="ibox-content">
                            <form method="get" action="{:url('User/UserList')}">
                                <div class="row">
                                    <div class="col-sm-3 m-b-xs">
                                        <div class="row">
                                            <div class="col-sm-2 m-b-xs"></div>
                                            <div class="col-sm-3 m-b-xs">订单编号</div>
                                            <div class="col-sm-7 m-b-xs">
                                                <input type="text" class="input-sm form-control input-s-sm inline" id="order_id" name="order_id" value="{$Data.order_id|default=''}">
                                            </div>
                                        </div>
                                    </div>
                                    <div class="col-sm-3 m-b-xs">
                                        <div class="row">
                                            <div class="col-sm-2 m-b-xs"></div>
                                            <div class="col-sm-3 m-b-xs">订单状态</div>
                                            <div class="col-sm-7 m-b-xs">
                                                <select class="input-sm form-control input-s-sm inline" id="status" name="status">
                                                    <option value="9" {if condition="$Data.status eq 9"}selected{/if}>全部</option>
                                                    <option value="0" {if condition="$Data.status eq 0"}selected{/if}>待付款</option>
                                                    <option value="1" {if condition="$Data.status eq 1"}selected{/if}>待发货</option>
                                                    <option value="2" {if condition="$Data.status eq 2"}selected{/if}>待收货</option>
                                                    <option value="3" {if condition="$Data.status eq 3"}selected{/if}>已完成</option>
                                                    <option value="5" {if condition="$Data.status eq 5"}selected{/if}>拼团成功</option>
                                                    <option value="6" {if condition="$Data.status eq 6"}selected{/if}>拼团失败</option>
                                                </select>
                                            </div>
                                        </div>
                                    </div>

                                    <div class="col-sm-3 m-b-xs">
                                        <div class="row">
                                            <div class="col-sm-2 m-b-xs"></div>
                                            <div class="col-sm-3 m-b-xs">收件姓名</div>
                                            <div class="col-sm-7 m-b-xs">
                                                <input type="text" class="input-sm form-control input-s-sm inline" id="name" name="name" value="{$Data.name|default=''}">
                                            </div>
                                        </div>
                                    </div>

                                    <div class="col-sm-3 m-b-xs">
                                        <div class="row">
                                            <div class="col-sm-2 m-b-xs"></div>
                                            <div class="col-sm-3 m-b-xs">收件手机</div>
                                            <div class="col-sm-7 m-b-xs">
                                                <input type="text" class="input-sm form-control input-s-sm inline" id="phone" name="phone" value="{$Data.phone|default=''}">
                                            </div>
                                        </div>
                                    </div>
                                </div>
                                <div class="row">
                                    <div class="col-sm-3 m-b-xs">
                                        <div class="row">
                                            <div class="col-sm-2 m-b-xs"></div>
                                            <div class="col-sm-3 m-b-xs">会员账号</div>
                                            <div class="col-sm-7 m-b-xs">
                                                <input type="text" class="input-sm form-control input-s-sm inline" id="username" name="username" value="{$Data.username|default=''}">
                                            </div>
                                        </div>
                                    </div>

                                    <div class="col-sm-3 m-b-xs">
                                        <div class="row">
                                            <div class="col-sm-2 m-b-xs"></div>
                                            <div class="col-sm-3 m-b-xs">开始时间</div>
                                            <div class="col-sm-7 m-b-xs">
                                                <input type="datetime-local" class="input-sm form-control input-s-sm inline" id="begin_time" name="begin_time" value="{$Data.begin_time|default=''}">
                                            </div>
                                        </div>
                                    </div>

                                    <div class="col-sm-3 m-b-xs">
                                        <div class="row">
                                            <div class="col-sm-2 m-b-xs"></div>
                                            <div class="col-sm-3 m-b-xs">结束时间</div>
                                            <div class="col-sm-7 m-b-xs">
                                                <input type="datetime-local" class="input-sm form-control input-s-sm inline" id="end_time" name="end_time" value="{$Data.end_time|default=''}">
                                            </div>
                                        </div>
                                    </div>

                                    <div class="col-sm-3 m-b-xs">
                                        <div class="row">
                                            <div class="col-sm-12 m-b-xs">
                                                <button class="btn btn-sm btn-primary" type="submit" id="search"><i class="fa fa-search"></i> 搜索</button>
                                                <button class="btn btn-sm btn-success" type="submit" id="export">导出Excel</button>
                                                 <a class="btn btn-sm btn-warning" href="javascript:;" onclick="user_import('导入','{:url("User/UserImport")}','800','282')">导入</a>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </form>
                            <div class="table-responsive">
                                <table class="table table-hover">
                                    <thead>
                                    <tr>
                                        <th>#</th>
                                        <th>订单号</th>
                                        <th>会员信息</th>
                                        <!-- <th>商品信息</th> -->
                                        <th>实际支付</th>
                                        <th>支付方式</th>
                                        <th>订单状态</th>
                                        <!--<th>邮寄方式</th>-->
                                        <th>下单时间</th>
                                        <th>支付时间</th>
                                        <th>操作</th>
                                    </tr>
                                    </thead>
                                    <tbody>
                                    {volist name="OrderList" id="v"}
                                    <tr>
                                        <td>{$key+1}</td>
                                        <td>{$v.order_id}</td>
                                        <td>{$v.username}</td>
                                        <!-- <td>
                                        {volist name="$v.goods" id="vo"}
                                        <img src="{$vo.logo_url}" style="max-width: 50px">{$vo.goods_name} | ￥{$vo.price} x{$vo.num}
                                        {/volist}
                                        </td> -->
                                        
                                        <td>
                                            {if condition="$v.status eq 0"}
                                                ￥{$v.amount}
                                            {else/}
                                                ￥{$v.pay_amount}
                                                {if condition="$v.pay_type eq 2 && $v.pay_point gt 0"}
                                                +{$v.pay_point}炁点
                                                {/if}
                                            {/if}
                                        </td>
                                        <td>
                                            {if condition="$v.pay_type eq 1"}积分支付
                                            {elseif condition="$v.pay_type eq 2"}奖金+炁点支付
                                            {elseif condition="$v.pay_type eq 3"}余额支付
                                            {elseif condition="$v.pay_type eq 4"}电子钱包+炁点支付
                                            {elseif condition="$v.pay_type eq 9"}微信支付
                                            {else/}未支付
                                            {/if}
                                        </td>
                                        <td>
                                            {if condition="$v.status eq 0"}待付款
                                            {elseif condition="$v.status eq 1" /}待发货
                                            {elseif condition="$v.status eq 2" /}待收货
                                            {elseif condition="$v.status eq 3" /}已完成
                                            {elseif condition="$v.status eq 4" /}待拼团
                                            {elseif condition="$v.status eq 5" /}拼团成功
                                            {elseif condition="$v.status eq 11" /}待退款
                                            {elseif condition="$v.status eq 12" /}已退款
                                            {elseif condition="$v.status eq 6" /}<font style="color:red">拼团失败</font>
                                            {/if}
                                        </td>
                                        <!--<td>-->
                                        <!--    {if condition="$v.post_type eq 1"}到付-->
                                        <!--    {elseif condition="$v.post_type eq 2" /}代付-->
                                        <!--    {elseif condition="$v.post_type eq 3" /}包邮-->
                                        <!--    {/if}-->
                                        <!--</td>-->
                                        <td>{$v.add_time|date="Y-m-d H:i:s",###}</td>
                                        <td>{if condition="$v.pay_time"}
                                                {$v.pay_time|date="Y-m-d H:i:s",###}
                                            {else/}
                                                未支付
                                            {/if}
                                        </td>
                                        <td>
                                            {if condition="$v.status eq 1 ||$v.status eq 5"}
                                            <a title="订单发货" href="javascript:;" onClick="order_send('物流信息','{:url("Order/OrderSend",["id"=>$v["id"]])}','800','328')"><i class="fa fa-truck text-navy"></i></a>
                                            {/if}
                                            <a title="订单详情" href="javascript:;" onclick="order_edit('订单详情','{:url("Order/OrderEdit",["id"=>$v["id"]])}','800','628')"><i class="fa fa-edit text-navy"></i></a>
                                            {if condition="$v.status eq 0 ||$v.status eq 6  "}
                                            <a title="订单删除" href="javascript:;" onClick="order_del(this,{$v.id})"><i class="fa fa-trash text-navy"></i></a>
                                            {/if}
                                            {if condition="$v.status gt 1 && $v.status lt 4"}
                                            <a title="物流信息" href="javascript:;" onClick="order_send('物流信息','{:url("Order/OrderSend",["id"=>$v["id"]])}','800','250')"><i class="fa fa-truck text-navy"></i></a>
                                            {/if}

                                        </td>
                                    </tr>
                                    {/volist}
                                    </tbody>
                                </table>
                            </div>
                            <div class="row" style="text-align: center">
                                {$Page}
                            </div>
                        </div>
                    </div>
                </div>

            </div>
        </div>
        {include file="public/foot"}

    </div>
</div>
</div>
{include file="public/footer"}
<script>
    /*条件搜索*/
    var searchurl = "{:url('Order/OrderList')}";
    $('#search').click(function () {

        $('form').attr('action',searchurl);
    });

    /*Excel导出*/
    var exporturl = "{:url('Order/OrderExport')}";
    $('#export').click(function () {

        $('form').attr('action',exporturl);
    });

    //导入
    function user_import(title,url,w,h){
        layer_show(title,url,w,h);
    }

    /*订单-编辑*/
    function order_edit(title,url,w,h){
        layer_show(title,url,w,h);
    }

    /*订单-编辑*/
    function order_send(title,url,w,h){
        layer_show(title,url,w,h);
    }

    /*订单-删除*/
    function order_del(obj,id){
        layer.confirm('确认要删除吗？',function(index){
            $.ajax({
                type:"post",
                url:"{:url('Order/OrderDelete')}",
                data:{
                    id:id,
                },
                dataType:"json",
                success:function(data){
                    if(data.status == 1){
                        layer.msg(data.message,{icon: 6,time:1500},function () {
                            window.location.reload();
                        });
                    }else{
                        layer.msg(data.message,{icon: 5,time:1500});
                    }
                }
            });
        });
    }


</script>
</body>
</html>
